<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    .header, .footer {
      width: 1200px;
      margin: 0 auto;
      background-color: skyblue;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 50px;
      height: 120px;
      color: #fff;
    }

    .footer {
      height: 300px;
    }

    ul, li {
      list-style: none;
    }

    ul {
      width: 1200px;
      display: flex;
      flex-wrap: wrap;
      margin: 0 auto;
      justify-content: space-between;
      padding-top: 10px;
    }

    li {
      width: 290px;
      border: 1px solid #333;
      margin-bottom: 10px;
      padding: 5px;
      box-sizing: border-box;
    }

    li > img {
      width: 278px;
      display: block;
    }

    .pagination {
      width: 1200px;
      margin: 10px auto;
      height: 50px;
      display: flex;
      align-items: center;
    }

    .pagination > .prev,
    .pagination > .next {
      width: 50px;
      height: 30px;
      cursor: pointer;
      background-color: orange;
      font-size: 24px;
      color: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .pagination > .disable {
      cursor: not-allowed;
      background-color: #ccc;
    }

    .pagination > .total {
      font-size: 30px;
      font-weight: 700;
      margin: 0 20px;
    }

    .pagination > select {
      font-size: 22px;
      padding-left: 20px;
      margin-left: 30px;
    }
  </style>
</head>
<body>

  <div class="header">网页头部</div>
  <div class="pagination">
    <span class="prev disable">&lt;</span>
    <span class="total">1 / 100</span>
    <span class="next">&gt;</span>
    <select>
      <option value="4">4</option>
      <option value="8">8</option>
      <option value="12">12</option>
      <option value="16">16</option>
    </select>
  </div>
  <ul>
     <!-- <li>
        <img src="https://img.alicdn.com/bao/uploaded/https://img.alicdn.com/imgextra/i3/2251059038/O1CN01zJEpaN2GdSG1Xvo8y_!!2251059038.jpg" alt="">
        <p>2020西太湖国际音乐节</p>
        <p>城市:常州</p>
        <p>地址:常州西太湖中国花卉博览景区北门</p>
        <p>价格:199-399</p>
        <p>时间:2020.09.19-09.20</p>
     </li>
     <li>
        <img src="https://img.alicdn.com/bao/uploaded/https://img.alicdn.com/imgextra/i3/2251059038/O1CN01zJEpaN2GdSG1Xvo8y_!!2251059038.jpg" alt="">
        <p>2020西太湖国际音乐节</p>
        <p>城市:常州</p>
        <p>地址:常州西太湖中国花卉博览景区北门</p>
        <p>价格:199-399</p>
        <p>时间:2020.09.19-09.20</p>
     </li>
     <li>
        <img src="https://img.alicdn.com/bao/uploaded/https://img.alicdn.com/imgextra/i3/2251059038/O1CN01zJEpaN2GdSG1Xvo8y_!!2251059038.jpg" alt="">
        <p>2020西太湖国际音乐节</p>
        <p>城市:常州</p>
        <p>地址:常州西太湖中国花卉博览景区北门</p>
        <p>价格:199-399</p>
        <p>时间:2020.09.19-09.20</p>
     </li>
     <li>
        <img src="https://img.alicdn.com/bao/uploaded/https://img.alicdn.com/imgextra/i3/2251059038/O1CN01zJEpaN2GdSG1Xvo8y_!!2251059038.jpg" alt="">
        <p>2020西太湖国际音乐节</p>
        <p>城市:常州</p>
        <p>地址:常州西太湖中国花卉博览景区北门</p>
        <p>价格:199-399</p>
        <p>时间:2020.09.19-09.20</p>
     </li>
     <li>
        <img src="https://img.alicdn.com/bao/uploaded/https://img.alicdn.com/imgextra/i3/2251059038/O1CN01zJEpaN2GdSG1Xvo8y_!!2251059038.jpg" alt="">
        <p>2020西太湖国际音乐节</p>
        <p>城市:常州</p>
        <p>地址:常州西太湖中国花卉博览景区北门</p>
        <p>价格:199-399</p>
        <p>时间:2020.09.19-09.20</p>
     </li>
     <li>
        <img src="https://img.alicdn.com/bao/uploaded/https://img.alicdn.com/imgextra/i3/2251059038/O1CN01zJEpaN2GdSG1Xvo8y_!!2251059038.jpg" alt="">
        <p>2020西太湖国际音乐节</p>
        <p>城市:常州</p>
        <p>地址:常州西太湖中国花卉博览景区北门</p>
        <p>价格:199-399</p>
        <p>时间:2020.09.19-09.20</p>
     </li>
     <li>
        <img src="https://img.alicdn.com/bao/uploaded/https://img.alicdn.com/imgextra/i3/2251059038/O1CN01zJEpaN2GdSG1Xvo8y_!!2251059038.jpg" alt="">
        <p>2020西太湖国际音乐节</p>
        <p>城市:常州</p>
        <p>地址:常州西太湖中国花卉博览景区北门</p>
        <p>价格:199-399</p>
        <p>时间:2020.09.19-09.20</p>
     </li>
     <li>
        <img src="https://img.alicdn.com/bao/uploaded/https://img.alicdn.com/imgextra/i3/2251059038/O1CN01zJEpaN2GdSG1Xvo8y_!!2251059038.jpg" alt="">
        <p>2020西太湖国际音乐节</p>
        <p>城市:常州</p>
        <p>地址:常州西太湖中国花卉博览景区北门</p>
        <p>价格:199-399</p>
        <p>时间:2020.09.19-09.20</p>
     </li> -->
  </ul>
  <div class="footer">网页底部</div>
  <script src="./data.js"></script>
  <script>
        // console.log(list)
//         var data = '';
//         list.forEach(function(item){
//             data += `<li>
//     <img src="${item.pic}" alt="">
//     <p>${item.name}</p>
//     <p>城市:${item.city}</p>
//     <p>地址:${item.address}</p>
//     <p>价格:${item.price}</p>
//     <p>时间:${item.showTime}</p>
//  </li>`});

//      document.querySelector('ul').innerHTML = data;

    var data = list.reduce(function(prev,item){
        return prev += `
        <li>
            <img src="${item.pic}" alt="">
            <p>${item.name}</p>     
            <p>城市:${item.city}</p>
            <p>地址:${item.address}</p>
            <p>价格:${item.price}</p>
            <p>时间:${item.showTime}</p>
        </li> 
        `
    },'');
    document.querySelector('ul').innerHTML = data;
  </script>
  </body>

  <!-- 公共的模板  <li>
    <img src="${}" alt="">
    <p>${}</p>
    <p>城市:${}</p>
    <p>地址:${}</p>
    <p>价格:${}</p>
    <p>时间:${}</p>
 </li> -->

 <!-- 遍历 总数据  一条数据一个li  多个li 拼接成一个大字符串  然后把这个大字符串赋值ul标签的innerHTML  -->
 
</html>

